package llvmir.value.constants;

import llvmir.type.Integer8Type;

public class ConstantChar extends Constant {
    private int value;

    // 根据类型和值构造常量
    public ConstantChar(int value) {
        super("ConstantChar", new Integer8Type());
        this.value = value;
    }

    public int getValue() {
        return value;
    }

    @Override
    public String toString() {
        return " " + value;
    }

    @Override
    public String toMips() {
        return ".word " + Integer.toString(value);
    }

    @Override
    public String getName() {
        return Integer.toString(value);
    }
}